using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;

namespace ERPBackend.Models
{
    public class EBOM : BaseModel
    {
        [Required]
        [StringLength(50)]
        public string BomCode { get; set; } = string.Empty;

        [Required]
        public int MaterialId { get; set; }

        [ForeignKey("MaterialId")]
        public Material? Material { get; set; }

        [StringLength(255)]
        public string? MaterialName { get; set; }

        [StringLength(255)]
        public string? MaterialSpecification { get; set; }

        [Required]
        [StringLength(50)]
        public string Version { get; set; } = string.Empty;

        [StringLength(50)]
        public string Status { get; set; } = string.Empty; // 草稿、已审核、已启用、已禁用

        public string? Description { get; set; }



        public int? ApprovedBy { get; set; }

        public DateTime? ApprovedTime { get; set; }

        public string? Remark { get; set; }

        public ICollection<EBOMItem>? EBOMItems { get; set; }

        public ICollection<EBOMChange>? EBOMChanges { get; set; }
    }
}